/**
 */
package mvc_generator.mVCGenerator.impl;

import mvc_generator.mVCGenerator.BusinessClass;
import mvc_generator.mVCGenerator.BusinessClassFieldAssignement;
import mvc_generator.mVCGenerator.MVCGeneratorPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Business Class Field Assignement</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link mvc_generator.mVCGenerator.impl.BusinessClassFieldAssignementImpl#getCreatedType <em>Created Type</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class BusinessClassFieldAssignementImpl extends FieldAssignementImpl implements BusinessClassFieldAssignement
{
  /**
   * The cached value of the '{@link #getCreatedType() <em>Created Type</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCreatedType()
   * @generated
   * @ordered
   */
  protected BusinessClass createdType;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected BusinessClassFieldAssignementImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return MVCGeneratorPackage.Literals.BUSINESS_CLASS_FIELD_ASSIGNEMENT;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BusinessClass getCreatedType()
  {
    if (createdType != null && createdType.eIsProxy())
    {
      InternalEObject oldCreatedType = (InternalEObject)createdType;
      createdType = (BusinessClass)eResolveProxy(oldCreatedType);
      if (createdType != oldCreatedType)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, MVCGeneratorPackage.BUSINESS_CLASS_FIELD_ASSIGNEMENT__CREATED_TYPE, oldCreatedType, createdType));
      }
    }
    return createdType;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public BusinessClass basicGetCreatedType()
  {
    return createdType;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setCreatedType(BusinessClass newCreatedType)
  {
    BusinessClass oldCreatedType = createdType;
    createdType = newCreatedType;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, MVCGeneratorPackage.BUSINESS_CLASS_FIELD_ASSIGNEMENT__CREATED_TYPE, oldCreatedType, createdType));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case MVCGeneratorPackage.BUSINESS_CLASS_FIELD_ASSIGNEMENT__CREATED_TYPE:
        if (resolve) return getCreatedType();
        return basicGetCreatedType();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case MVCGeneratorPackage.BUSINESS_CLASS_FIELD_ASSIGNEMENT__CREATED_TYPE:
        setCreatedType((BusinessClass)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case MVCGeneratorPackage.BUSINESS_CLASS_FIELD_ASSIGNEMENT__CREATED_TYPE:
        setCreatedType((BusinessClass)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case MVCGeneratorPackage.BUSINESS_CLASS_FIELD_ASSIGNEMENT__CREATED_TYPE:
        return createdType != null;
    }
    return super.eIsSet(featureID);
  }

} //BusinessClassFieldAssignementImpl
